Skip to content

Refactor mixed_keyword_cypher.py file and added comments in code #8633

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

Ranausama420
Copy link

Describe your change:

changed below lines added sets functionality and remove for loops to get unique element in list
temp = list(set(key))
len_temp = len(temp)

string module can used to generate alphabets list instead of using loops
alpha = list(string.ascii_uppercase)

and used string join method to generate cypher

Resolves #8622

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Documentation change?

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new Python files are placed inside an existing directory.
  • All filenames are in all lowercase characters with no spaces or dashes.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with Python type hints.
  • All functions have doctests that pass the automated testing.
  • All new algorithms include at least one URL that points to Wikipedia or another similar explanation.
  • If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.

@algorithms-keeper algorithms-keeper bot added awaiting reviews This PR is ready to be reviewed enhancement This PR modified some existing files tests are failing Do not merge until tests pass labels Apr 10, 2023
@tianyizheng02 tianyizheng02 mentioned this pull request Apr 14, 2023
14 tasks
Copy link
Contributor

@tianyizheng02 tianyizheng02 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.

Copy link

@ankit-gautam23 ankit-gautam23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Effective changes with neat one liner comment. I don't think it gonna break anywhere in the system.

@tianyizheng02
Copy link
Contributor

  1. As @CaedenPH said in your duplicate PR Documentation #8646, the documentation doesn't add much value because it just talks through the code, with most of the info easily inferable from the code itself.
  2. This issue was already resolved in Improve readability of ciphers/mixed_keyword_cypher.py #8626.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting reviews This PR is ready to be reviewed enhancement This PR modified some existing files tests are failing Do not merge until tests pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor code so it's readable
3 participants